
package com.jf.cloud.product.service.impl;

import com.jf.cloud.common.database.dto.PageDTO;
import com.jf.cloud.common.database.util.PageUtil;
import com.jf.cloud.common.database.vo.PageVO;
import com.jf.cloud.product.dto.SpuPriceLogDTO;
import com.jf.cloud.product.mapper.SpuPriceLogMapper;
import com.jf.cloud.product.model.SpuPriceLog;
import com.jf.cloud.product.service.SpuPriceLogService;
import com.jf.cloud.product.vo.SpuPriceLogVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 商品调价记录
 *
 * @author zz
 * @date 2022-06-29 17:48:25
 */
@Service
public class SpuPriceLogServiceImpl implements SpuPriceLogService {

    @Autowired
    private SpuPriceLogMapper spuPriceLogMapper;

    @Override
    public PageVO<SpuPriceLogVO> page(PageDTO pageDTO, SpuPriceLogDTO spuPriceLogDTO) {
        return PageUtil.doPage(pageDTO, () -> spuPriceLogMapper.pageByParam(spuPriceLogDTO));
    }

    @Override
    public SpuPriceLog getById(Long id) {
        return spuPriceLogMapper.getById(id);
    }

    @Override
    public void save(SpuPriceLog spuPriceLog) {
        spuPriceLogMapper.save(spuPriceLog);
    }

    @Override
    public void update(SpuPriceLog spuPriceLog) {
        spuPriceLogMapper.update(spuPriceLog);
    }

    @Override
    public void deleteById(Long id) {
        spuPriceLogMapper.deleteById(id);
    }
}
